package com.better.frontend.controller.scoresegment;

import com.better.backend.dataComputingService.model.stuScore.ExamStudentScoreCalModel;
import com.better.common.base.ServiceResponse;
import com.better.common.utils.ServiceResponseHandle;
import com.better.frontend.Iservice.scoresegment.SegmentMangerService;
import com.better.frontend.model.scoresegment.ClassSementCompParm;
import com.better.frontend.model.scoresegment.ClassSementParm;
import com.better.frontend.model.scoresegment.ScoreSementParm;
import com.better.frontend.model.scoresegment.SegementParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;


/**
 * 分数段管理
 * Created by Administrator on 2017/11/16.
 */
@Api(value = "分数段管理", tags = "数段管理接口")
@RestController
@RequestMapping("/api/segment")
public class SegmentManagerController {
    @Resource
    private SegmentMangerService segmentMangerService;

    @ApiOperation(value = "查看学生分数段信息", notes = "查看学生分数段信息")
    @RequestMapping(value = "/getscoresegment", method = RequestMethod.POST)
    public ServiceResponse<?> scoresegment(@RequestBody ScoreSementParm scoreSementParm) {
        return ServiceResponseHandle.success(segmentMangerService.getSegment(scoreSementParm));
    }

    @ApiOperation(value = "查看学生历史统计", notes = "查看学生历史统计")
    @PostMapping(value = "historiyStatistics")
    public ServiceResponse<?> historicalStatistics(@RequestBody ScoreSementParm scoreSementParm) {
        return ServiceResponseHandle.success(segmentMangerService.historicalStatistics(scoreSementParm));
    }

    @ApiOperation(value = "班级分析分数段统计", notes = "班级分析分数段统计")
    @PostMapping(value = "/classSement")
    public ServiceResponse<?> classSement(@RequestBody ClassSementParm scoreSementParm) {
        return segmentMangerService.classSement(scoreSementParm);
    }

    @ApiOperation(value = "班级分析分数段学生列表", notes = "班级分析分数段学生列表")
    @PostMapping(value = "/classSementStudent")
    public ServiceResponse<?> classSementStudent(@RequestBody ClassSementParm scoreSementParm) {
        return segmentMangerService.classSementStudent(scoreSementParm);
    }

    @ApiOperation(value = "班级分析分数段学生对比", notes = "班级分析分数段学生对比")
    @PostMapping(value = "/classSementCompare")
    public ServiceResponse<?> classSementCompare(@RequestBody ClassSementCompParm classSementCompParm) {
        return segmentMangerService.classTotalAndSubSementCompare(classSementCompParm);
    }

    /**
     *  班级知识点对比
     * @param classSementCompParm
     * @return
     */
    @ApiOperation(value = "获取当前考试得分情况", notes = "获取当前考试得分情况")
    @PostMapping(value = "/classKnowledgeCompare")
    public ServiceResponse<?> classKnowledgeCompare(@RequestBody ClassSementCompParm classSementCompParm) {
        return segmentMangerService.classKnowledgeCompare(classSementCompParm);
    }
    /**
     *  考试历次成绩对比
     * @param classSementCompParm
     * @return
     */
    @ApiOperation(value = "历次考试成绩对比", notes = "历次考试成绩对比")
    @PostMapping(value = "/classExamCompare")
    public ServiceResponse<?> classExamCompare(@RequestBody ClassSementCompParm classSementCompParm) {
        return segmentMangerService.classExamCompare(classSementCompParm);
    }

    /**
     *
     *  根据类型获得对应的考试或者班级
     * @param classSementCompParm
     * @return
     */
    @ApiOperation(value = "根据类型获得对应的考试或者班级", notes = "根据类型获得对应的考试或者班级")
    @PostMapping(value = "/getClassOrExam")
    public ServiceResponse<?> getClassOrExam(@RequestBody SegementParam segementParam) {
        return segmentMangerService.getClassOrExam(segementParam);
    }


}
